package br.ufmt.baseDeDados;

import java.util.ArrayList;
import java.util.List;

import br.ufmt.exception.MidiaException;
import br.ufmt.model.Midia;
import br.ufmt.model.MidiaEnum;


public class Midias {

	private static List<Midia> midias = new ArrayList<Midia>();

	public static List<Midia> getMidias() {
		if (midias.isEmpty()) {
			try {
				midias.add(new Midia(Obras.getObras().get(0), MidiaEnum.DVD, 4));
				midias.add(new Midia(Obras.getObras().get(0), MidiaEnum.BD, 2));
				midias.add(new Midia(Obras.getObras().get(1), MidiaEnum.BD, 4));
				midias.add(new Midia(Obras.getObras().get(1), MidiaEnum.DVD, 12));
				midias.add(new Midia(Obras.getObras().get(2), MidiaEnum.BD, 1));
				midias.add(new Midia(Obras.getObras().get(3), MidiaEnum.DVD, 6));
				midias.add(new Midia(Obras.getObras().get(4), MidiaEnum.DVD, 3));
				midias.add(new Midia(Obras.getObras().get(5), MidiaEnum.BD, 9));
			} catch (MidiaException e) {
				e.printStackTrace();
			}
			
			
		}
		return midias;
	}

	public static void setObras(List<Midia> midias) {
		Midias.midias = midias;
	}

}